Method and apparatus for encoding/decoding motion vector

ABSTRACT

Provided are methods and apparatuses for encoding and decoding a motion vector. The method of encoding the motion vector includes: selecting, as a mode of encoding information about a motion vector predictor of the current block, a first mode in which information indicating the motion vector predictor from among at least one motion vector predictor is encoded or a second mode in which information indicating generation of the motion vector predictor based on blocks or pixels included in a previously encoded area adjacent to the current block is encoded; determining the motion vector predictor of the current block according to the selected mode and encoding the information about the motion vector predictor of the current block; and encoding a difference vector between the motion vector of the current block and the motion vector predictor of the current block.

CROSS-REFERENCE TO RELATED PATENT APPLICATION

This application is a continuation application of U.S. application Ser.No. 13/670,018, filed Nov. 6, 2012 in the United States Patent andTrademark Office, which is a continuation application of U.S.application Ser. No. 13/403,476, filed on Feb. 23, 2012, in the UnitedStates Patent and Trademark Office, now U.S. Pat. No. 8,311,118 issuedNov. 13, 2012, which is a continuation of U.S. application Ser. No.12/856,197, filed on Aug. 13, 2010, in the U.S. Patent and TrademarkOffice, which claims priority from Korean Patent Application No.10-2009-0074896, filed on Aug. 13, 2009, in the Korean IntellectualProperty Office, the disclosures of which are incorporated herein byreference in their entireties.

BACKGROUND

1. Field

Apparatuses and methods consistent with exemplary embodiments relate toa method and apparatus for encoding a motion vector, and moreparticularly, to a method and apparatus for encoding a motion vectorpredictor of a current block.

2. Description of Related Art

A codec, such as Moving Pictures Experts Group (MPEG)-4 H.264/MPEG-4Advanced Video Coding (AVC), uses motion vectors of previously encodedblocks adjacent to a current block to predict a motion vector of thecurrent block. That is, a median of motion vectors of previously encodedblocks adjacent to left, upper, and upper-right sides of a current blockis used as a motion vector predictor of the current block.

SUMMARY

Exemplary embodiments provide a method and apparatus for encoding anddecoding a motion vector, and a computer readable recording mediumstoring a computer readable program for executing the method.

According to an aspect of an exemplary embodiment, there is provided amethod of encoding a motion vector of a current block, the methodincluding: selecting, as a mode of encoding information about a motionvector predictor of the current block, a first mode in which informationindicating the motion vector predictor from among at least one motionvector predictor is encoded or a second mode in which informationindicating generation of the motion vector predictor based on blocks orpixels included in a previously encoded area adjacent to the currentblock is encoded; determining the motion vector predictor of the currentblock according to the selected mode and encoding the information aboutthe motion vector predictor of the current block; and encoding adifference vector between the motion vector of the current block and themotion vector predictor of the current block.

The selecting of the first mode or the second mode may include selectingthe first mode or the second mode based on a depth indicating a degreeof decreasing from a size of a maximum coding unit of a current pictureor slice to a size of the current block.

The selecting of the first mode or the second mode may include selectingthe first mode or the second mode in a unit of a current picture orslice including the current block.

The selecting of the first mode or the second mode may include selectingthe first mode or the second mode based on whether the current block isencoded in a skip mode.

The at least one motion vector predictor may include a first motionvector of a block adjacent to a left side of the current block, a secondmotion vector of a block adjacent to an upper side of the current block,and a third motion vector of a block adjacent to an upper-right side ofthe current block.

The at least one motion vector predictor may further include a medianvalue of the first motion vector, the second motion vector, and thethird motion vector.

The at least one motion vector predictor may further include a motionvector predictor generated based on a motion vector of a blockco-located with the current block in a reference picture and a temporaldistance between the reference picture and a current picture.

The information indicating generation of the motion vector predictorbased on blocks or pixels included in a previously encoded area adjacentto the current block may be information indicating generation of themotion vector predictor of the current block based on a median value ofa first motion vector of a block adjacent to a left side of the currentblock, a second motion vector of a block adjacent to an upper side ofthe current block, and a third motion vector of a block adjacent to anupper-right side of the current block.

The information indicating generation of the motion vector predictorbased on blocks or pixels included in a previously encoded area adjacentto the current block may be information indicating generation of themotion vector predictor of the current block based on a motion vectorgenerated by searching a reference picture using pixels included in thepreviously encoded area adjacent to the current block.

According to an aspect of another exemplary embodiment, there isprovided an apparatus for encoding a motion vector of a current block,the apparatus including: a predictor which selects, as a mode ofencoding information about a motion vector predictor of the currentblock, a first mode in which information indicating the motion vectorpredictor from among at least one motion vector predictor is encoded ora second mode in which information indicating generation of the motionvector predictor based on blocks or pixels included in a previouslyencoded area adjacent to the current block is encoded, and whichdetermines the motion vector predictor of the current block based on theselected mode; a first encoder which encodes the information about themotion vector predictor of the current block determined based on theselected mode; and a second encoder which encodes a difference vectorbetween a motion vector of the current block and the motion vectorpredictor of the current block.

According to an aspect of another exemplary embodiment, there isprovided a method of decoding a motion vector of a current block, themethod including: decoding information about a motion vector predictorof the current block encoded according to a mode selected from among afirst mode and a second mode; decoding a difference vector between themotion vector of the current block and the motion vector predictor ofthe current block; generating the motion vector predictor of the currentblock based on the decoded information about the motion vector predictorof the current block; and restoring the motion vector of the currentblock based on the motion vector predictor and the difference vector,wherein the first mode is a mode in which information indicating themotion vector predictor from among at least one motion vector predictoris encoded and the second mode is a mode in which information indicatinggeneration of the motion vector predictor based on blocks or pixelsincluded in a previously decoded area adjacent to the current block isencoded.

According to an aspect of another exemplary embodiment, there isprovided an apparatus for decoding a motion vector of a current block,the apparatus including: a first decoder which decodes information abouta motion vector predictor of the current block encoded according to amode selected from among a first mode and a second mode; a seconddecoder which decodes a difference vector between the motion vector ofthe current block and the motion vector predictor of the current block;a predictor which generates the motion vector predictor of the currentblock based on the decoded information about the motion vector predictorof the current block; and a motion vector restoring unit which restoresthe motion vector of the current block based on the motion vectorpredictor and the difference vector, wherein the first mode is a mode inwhich information indicating the motion vector predictor from among atleast one motion vector predictor is encoded and the second mode is amode in which information indicating generation of the motion vectorpredictor based on blocks or pixels included in a previously decodedarea adjacent to the current block is encoded.

According to an aspect of another exemplary embodiment, there isprovided a computer readable recording medium storing a computerreadable program for executing the method of encoding a motion vectorand the method of decoding a motion vector.

BRIEF DESCRIPTION OF THE DRAWINGS

The above and/or other aspects will become more apparent by describingin detail exemplary embodiments with reference to the attached drawingsin which:

FIG. 1 is a block diagram of an apparatus for encoding an imageaccording to an exemplary embodiment;

FIG. 2 is a block diagram of an apparatus for decoding an imageaccording to an exemplary embodiment;

FIG. 3 illustrates hierarchical coding units according to an exemplaryembodiment;

FIG. 4 is a block diagram of an image encoder based on a coding unit,according to an exemplary embodiment;

FIG. 5 is a block diagram of an image decoder based on a coding unit,according to an exemplary embodiment;

FIG. 6 illustrates a maximum coding unit, a sub coding unit, and aprediction unit, according to an exemplary embodiment;

FIG. 7 illustrates a coding unit and a transformation unit, according toan exemplary embodiment;

FIGS. 8A and 8B illustrate division shapes of a coding unit, aprediction unit, and a transformation unit, according to an exemplaryembodiment;

FIG. 9 is a block diagram of an apparatus for encoding a motion vector,according to an exemplary embodiment;

FIGS. 10A and 10B illustrate motion vector predictor candidates of anexplicit mode, according to an exemplary embodiment;

FIGS. 11A to 11C illustrate motion vector predictor candidates of anexplicit mode, according to another exemplary embodiment;

FIG. 12 illustrates a method of generating a motion vector predictor inan implicit mode, according to an exemplary embodiment;

FIG. 13 is a block diagram of an apparatus for decoding a motion vector,according to an exemplary embodiment;

FIG. 14 is a flowchart of a method of encoding a motion vector,according to an exemplary embodiment; and

FIG. 15 is a flowchart of a method of decoding a motion vector,according to an exemplary embodiment.

DETAILED DESCRIPTION OF EXEMPLARY EMBODIMENTS

Exemplary embodiments will now be described more fully with reference tothe accompanying drawings, in which like reference numerals refer tolike elements throughout. Expressions such as “at least one of,” whenpreceding a list of elements, modify the entire list of elements and donot modify the individual elements of the list. In the presentspecification, an “image” may denote a still image for a video or amoving image, that is, the video itself.

FIG. 1 is a block diagram of an apparatus 100 for encoding an image,according to an exemplary embodiment. Referring to FIG. 1, the apparatus100 includes a maximum coding unit divider 110, an encoding depthdeterminer 120, an image data encoder 130, and an encoding informationencoder 140.

The maximum coding unit divider 110 can divide a current picture orslice based on a maximum coding unit that is an encoding unit of alargest size. That is, the maximum coding unit divider 110 can dividethe current picture or slice to obtain at least one maximum coding unit.

According to an exemplary embodiment, a coding unit may be representedusing a maximum coding unit and a depth. As described above, the maximumcoding unit indicates a coding unit having the largest size from amongcoding units of the current picture, and the depth indicates the size ofa sub coding unit obtained by hierarchically decreasing the coding unit.As the depth increases, the coding unit can decrease from a maximumcoding unit to a minimum coding unit, wherein a depth of the maximumcoding unit is defined as a minimum depth and a depth of the minimumcoding unit is defined as a maximum depth. Since the size of the codingunit decreases from the maximum coding unit as the depth increases, asub coding unit of a k^(th) depth can include a plurality of sub codingunits of a (k+n)^(th) depth (where k and n are integers equal to orgreater than 1).

According to an increase of the size of a picture to be encoded,encoding an image in a greater coding unit can cause a higher imagecompression ratio. However, if a greater coding unit is fixed, an imagemay not be efficiently encoded by reflecting continuously changing imagecharacteristics.

For example, when a smooth area such as the sea or the sky is encoded,the greater a coding unit is, the more a compression ratio can increase.However, when a complex area such as people or buildings is encoded, thesmaller a coding unit is, the more a compression ratio can increase.

Accordingly, according to an exemplary embodiment, a different maximumimage coding unit and a different maximum depth are set for each pictureor slice. Since a maximum depth denotes the maximum number of times bywhich a coding unit can decrease, the size of each minimum coding unitincluded in a maximum image coding unit can be variably set according toa maximum depth.

The encoding depth determiner 120 determines a maximum depth. Forexample, the maximum depth can be determined based on calculation ofRate-Distortion (R-D) cost. Furthermore, the maximum depth may bedetermined differently for each picture or slice or for each maximumcoding unit. The determined maximum depth is provided to the encodinginformation encoder 140, and image data according to maximum codingunits is provided to the image data encoder 130.

The maximum depth denotes a coding unit having the smallest size thatcan be included in a maximum coding unit, i.e., a minimum coding unit.In other words, a maximum coding unit can be divided into sub codingunits having different sizes according to different depths. This will bedescribed in detail later with reference to FIGS. 8A and 8B. Inaddition, the sub coding units having different sizes, which areincluded in the maximum coding unit, can be predicted or transformedbased on processing units having different sizes. In other words, theapparatus 100 can perform a plurality of processing operations for imageencoding based on processing units having various sizes and variousshapes. To encode image data, processing operations such as prediction,transformation, and entropy encoding are performed, wherein processingunits having the same size may be used for every operation or processingunits having different sizes may be used for every operation.

For example, the apparatus 100 may select a processing unit that isdifferent from a coding unit to predict the coding unit. When the sizeof a coding unit is 2N×2N (where N is a positive integer), processingunits for prediction may be 2N×2N, 2N×N, N×2N, and N×N. In other words,motion prediction may be performed based on a processing unit having ashape whereby at least one of height and width of a coding unit isequally divided by two. Hereinafter, a processing unit, which is thebase of prediction, is referred to as a prediction unit.

A prediction mode may be at least one of an intra mode, an inter mode,and a skip mode, and a specific prediction mode may be performed foronly a prediction unit having a specific size or shape. For example, theintra mode may be performed for only prediction units having sizes of2N×2N and N×N of which the shape is a square. Further, the skip mode maybe performed for only a prediction unit having a size of 2N×2N. If aplurality of prediction units exist in a coding unit, the predictionmode with the least encoding errors may be selected after performingprediction for every prediction unit.

Alternatively, the apparatus 100 may perform frequency transformation onimage data based on a processing unit having a different size from acoding unit. For the frequency transformation in the coding unit, thefrequency transformation can be performed based on a processing unithaving a size equal to or less than that of the coding unit.Hereinafter, a processing unit, which is the base of frequencytransformation, is referred to as a transformation unit. The frequencytransformation may be a Discrete Cosine Transform (DCT) or aKarhunen-Loeve Transform (KLT).

The encoding depth determiner 120 can determine sub coding unitsincluded in a maximum coding unit using R-D optimization based on aLagrangian multiplier. In other words, the encoding depth determiner 120can determine which shape a plurality of sub coding units divided fromthe maximum coding unit have, wherein the plurality of sub coding unitshave different sizes according to their depths. The image data encoder130 outputs a bitstream by encoding the maximum coding unit based on thedivision shapes determined by the encoding depth determiner 120.

The encoding information encoder 140 encodes information about anencoding mode of the maximum coding unit determined by the encodingdepth determiner 120. In other words, the encoding information encoder140 outputs a bitstream by encoding information about a division shapeof the maximum coding unit, information about the maximum depth, andinformation about an encoding mode of a sub coding unit for each depth.The information about the encoding mode of the sub coding unit mayinclude at least one of information about a prediction unit of the subcoding unit, information about a prediction mode for each predictionunit, and information about a transformation unit of the sub codingunit.

Since sub coding units having different sizes exist for each maximumcoding unit and information about an encoding mode is determined foreach sub coding unit, information about at least one encoding mode maybe determined for one maximum coding unit.

The apparatus 100 may generate sub coding units by equally dividing bothheight and width of a maximum coding unit by two according to anincrease of depth. That is, when the size of a coding unit of a k^(th)depth is 2N×2N, the size of a coding unit of a (k+1)^(th) depth may beN×N.

Accordingly, the apparatus 100 according to an exemplary embodiment candetermine an optimal division shape for each maximum coding unit basedon sizes of maximum coding units and a maximum depth in consideration ofimage characteristics. By variably adjusting the size of a maximumcoding unit in consideration of image characteristics and encoding animage through division of a maximum coding unit into sub coding units ofdifferent depths, images having various resolutions can be moreefficiently encoded.

FIG. 2 is a block diagram of an apparatus 200 for decoding an imageaccording to an exemplary embodiment. Referring to FIG. 2, the apparatus200 includes an image data acquisition unit 210, an encoding informationextractor 220, and an image data decoder 230.

The image data acquisition unit 210 acquires image data according tomaximum coding units by parsing a bitstream received by the apparatus200 and outputs the image data to the image data decoder 230. The imagedata acquisition unit 210 may extract information about a maximum codingunit of a current picture or slice from a header of the current pictureor slice. In other words, the image data acquisition unit 210 dividesthe bitstream in the maximum coding unit so that the image data decoder230 can decode the image data according to maximum coding units.

The encoding information extractor 220 extracts information about amaximum coding unit, a maximum depth, a division shape of the maximumcoding unit, and an encoding mode of sub coding units by parsing thebitstream received by the apparatus 200. For example, the encodinginformation extractor 220 may extract the above-described informationfrom the header of the current picture. The information about thedivision shape and the information about the encoding mode are providedto the image data decoder 230.

The information about the division shape of the maximum coding unit mayinclude information about sub coding units having different sizesaccording to depths included in the maximum coding unit, and theinformation about the encoding mode may include at least one ofinformation about a prediction unit according to sub coding unit,information about a prediction mode, and information about atransformation unit.

The image data decoder 230 restores the current picture by decodingimage data of every maximum coding unit based on the informationextracted by the encoding information extractor 220. The image datadecoder 230 can decode sub coding units included in a maximum codingunit based on the information about the division shape of the maximumcoding unit. A decoding process may include at least one of a predictionprocess including intra prediction and motion compensation and aninverse transformation process.

Furthermore, the image data decoder 230 can perform intra prediction orinter prediction based on the information about the prediction unit andthe information about the prediction mode in order to predict aprediction unit. The image data decoder 230 can also perform inversetransformation for each sub coding unit based on the information aboutthe transformation unit of a sub coding unit.

FIG. 3 illustrates hierarchical coding units according to an exemplaryembodiment. Referring to FIG. 3, the exemplary hierarchical coding unitsinclude coding units whose sizes are 64×64, 32×32, 16×16, 8×8, and 4×4.Furthermore, coding units whose sizes are 64×32, 32×64, 32×16, 16×32,16×8, 8×16, 8×4, and 4×8 may also exist.

In the exemplary embodiment illustrated in FIG. 3, for first image data310 whose resolution is 1920×1080, the size of a maximum coding unit isset to 64×64, and a maximum depth is set to 2. For second image data 320whose resolution is 1920×1080, the size of a maximum coding unit is setto 64×64, and a maximum depth is set to 3. For third image data 330whose resolution is 352×288, the size of a maximum coding unit is set to16×16, and a maximum depth is set to 1.

When the resolution is high or the amount of data is great, a maximumsize of a coding unit may be relatively large to increase a compressionratio and exactly reflect image characteristics. Accordingly, for thefirst and second image data 310 and 320 having higher resolution thanthe third image data 330, 64×64 may be selected as the size of themaximum coding unit.

A maximum depth indicates the total number of layers in the hierarchicalcoding units. Since the maximum depth of the first image data 310 is 2,a coding unit 315 of the image data 310 can include a maximum codingunit whose longer axis size is 64 and sub coding units whose longer axissizes are 32 and 16, according to an increase of a depth.

On the other hand, since the maximum depth of the third image data 330is 1, a coding unit 335 of the image data 330 can include a maximumcoding unit whose longer axis size is 16 and coding units whose longeraxis sizes is 8, according to an increase of a depth.

However, since the maximum depth of the second image data 320 is 3, acoding unit 325 of the image data 320 can include a maximum coding unitwhose longer axis size is 64 and sub coding units whose longer axissizes are 32, 16, and 8 according to an increase of a depth. Since animage is encoded based on a smaller sub coding unit as a depthincreases, exemplary embodiments are suitable for encoding an imageincluding more minute scenes.

FIG. 4 is a block diagram of an image encoder 400 based on a codingunit, according to an exemplary embodiment. Referring to FIG. 4, anintra predictor 410 performs intra prediction on prediction units of theintra mode in a current frame 405, and a motion estimator 420 and amotion compensator 425 perform inter prediction and motion compensationon prediction units of the inter mode using the current frame 405 and areference frame 495.

Residual values are generated based on the prediction units output fromthe intra predictor 410, the motion estimator 420, and the motioncompensator 425. The generated residual values are output as quantizedtransform coefficients by passing through a transformer 430 and aquantizer 440.

The quantized transform coefficients are restored to residual values bypassing through an inverse-quantizer 460 and an inverse transformer 470.The restored residual values are post-processed by passing through adeblocking unit 480 and a loop filtering unit 490 and output as thereference frame 495. The quantized transform coefficients may be outputas a bitstream 455 by passing through an entropy encoder 450.

To perform encoding based on an encoding method according to anexemplary embodiment, components of the image encoder 400, i.e., theintra predictor 410, the motion estimator 420, the motion compensator425, the transformer 430, the quantizer 440, the entropy encoder 450,the inverse-quantizer 460, the inverse-transformer 470, the deblockingunit 480 and the loop filtering unit 490, perform image encodingprocesses based on a maximum coding unit, a sub coding unit according todepths, a prediction unit, and a transformation unit.

FIG. 5 is a block diagram of an image decoder 500 based on a codingunit, according to an exemplary embodiment. Referring to FIG. 5, abitstream 505 passes through a parser 510 so that encoded image data tobe decoded and encoding information used for decoding are parsed. Theencoded image data is output as inverse-quantized data by passingthrough an entropy decoder 520 and an inverse-quantizer 530 and restoredto residual values by passing through an inverse-transformer 540. Theresidual values are restored according to coding units by being added toan intra prediction result of an intra predictor 550 or a motioncompensation result of a motion compensator 560. The restored codingunits are used for prediction of next coding units or a next picture bypassing through a deblocking unit 570 and a loop filtering unit 580.

To perform decoding based on a decoding method according to an exemplaryembodiment, components of the image decoder 500, i.e., the parser 510,the entropy decoder 520, the inverse-quantizer 530, theinverse-transformer 540, the intra predictor 550, the motion compensator560, the deblocking unit 570 and the loop filtering unit 580, performimage decoding processes based on a maximum coding unit, a sub codingunit according to depths, a prediction unit, and a transformation unit.

In particular, the intra predictor 550 and the motion compensator 560determine a prediction unit and a prediction mode in a sub coding unitby considering a maximum coding unit and a depth, and theinverse-transformer 540 performs inverse transformation by consideringthe size of a transformation unit.

FIG. 6 illustrates a maximum coding unit, a sub coding unit, and aprediction unit, according to an exemplary embodiment.

As described above, the encoding apparatus 100 and the decodingapparatus 200 according to one or more exemplary embodiments usehierarchical coding units to perform encoding and decoding inconsideration of image characteristics. A maximum coding unit and amaximum depth can be adaptively set according to the imagecharacteristics or variously set according to requirements of a user.

Referring to FIG. 6, a hierarchical coding unit structure 600 accordingto an exemplary embodiment illustrates a maximum coding unit 610 whoseheight and width are 64 and maximum depth is 4. A depth increases alonga vertical axis of the hierarchical coding unit structure 600, and as adepth increases, heights and widths of sub coding units 620 to 650decrease. Prediction units of the maximum coding unit 610 and the subcoding units 620 to 650 are shown along a horizontal axis of thehierarchical coding unit structure 600.

The maximum coding unit 610 has a depth of 0 and a size, i.e., heightand width, of 64×64. A depth increases along the vertical axis, suchthat there exist a sub coding unit 620 whose size is 32×32 and depth is1, a sub coding unit 630 whose size is 16×16 and depth is 2, a subcoding unit 640 whose size is 8×8 and depth is 3, and a sub coding unit650 whose size is 4×4 and depth is 4. The sub coding unit 650 whose sizeis 4×4 and depth is 4 is a minimum coding unit. The minimum coding unit650 may be divided into prediction units, each of which is less than theminimum coding unit.

In the exemplary embodiment illustrated in FIG. 6, examples of aprediction unit are shown along the horizontal axis according to eachdepth. That is, a prediction unit of the maximum coding unit 610 whosedepth is 0 may be a prediction unit whose size is equal to the codingunit 610, i.e., 64×64, or a prediction unit 612 whose size is 64×32, aprediction unit 614 whose size is 32×64, or a prediction unit 616 whosesize is 32×32, which have a size smaller than the coding unit 610 whosesize is 64×64.

A prediction unit of the coding unit 620 whose depth is 1 and size is32×32 may be a prediction unit whose size is equal to the coding unit620, i.e., 32×32, or a prediction unit 622 whose size is 32×16, aprediction unit 624 whose size is 16×32, or a prediction unit 626 whosesize is 16×16, which have a size smaller than the coding unit 620 whosesize is 32×32.

A prediction unit of the coding unit 630 whose depth is 2 and size is16×16 may be a prediction unit whose size is equal to the coding unit630, i.e., 16×16, or a prediction unit 632 whose size is 16×8, aprediction unit 634 whose size is 8×16, or a prediction unit 636 whosesize is 8×8, which have a size smaller than the coding unit 630 whosesize is 16×16.

A prediction unit of the coding unit 640 whose depth is 3 and size is8×8 may be a prediction unit whose size is equal to the coding unit 640,i.e., 8×8, or a prediction unit 642 whose size is 8×4, a prediction unit644 whose size is 4×8, or a prediction unit 646 whose size is 4×4, whichhave a size smaller than the coding unit 640 whose size is 8×8.

The coding unit 650 whose depth is 4 and size is 4×4 is a minimum codingunit and a coding unit of a maximum depth. A prediction unit of thecoding unit 650 may be a prediction unit 650 whose size is 4×4, aprediction unit 652 having a size of 4×2, a prediction unit 654 having asize of 2×4, or a prediction unit 656 having a size of 2×2.

FIG. 7 illustrates a coding unit and a transformation unit, according toan exemplary embodiment. The encoding apparatus 100 and the decodingapparatus 200, according to one or more exemplary embodiments, performencoding with a maximum coding unit itself or with sub coding units,which are equal to or smaller than the maximum coding unit and dividedfrom the maximum coding unit.

In the encoding process, the size of a transformation unit for frequencytransformation is selected to be no larger than that of a correspondingcoding unit. For example, when a current coding unit 710 has a size of64×64, frequency transformation can be performed using a transformationunit 720 having a size of 32×32.

FIGS. 8A and 8B illustrate division shapes of a coding unit, aprediction unit, and a transformation unit, according to an exemplaryembodiment. FIG. 8A illustrates a coding unit and a prediction unit,according to an exemplary embodiment.

A left side of FIG. 8A shows a division shape selected by an encodingapparatus 100 according to an exemplary embodiment in order to encode amaximum coding unit 810. The apparatus 100 divides the maximum codingunit 810 into various shapes, performs encoding, and selects an optimaldivision shape by comparing encoding results of various division shapeswith each other based on R-D cost. When it is optimal that the maximumcoding unit 810 is encoded as is, the maximum coding unit 810 may beencoded without dividing the maximum coding unit 810 as illustrated inFIGS. 8A and 8B.

Referring to the left side of FIG. 8A, the maximum coding unit 810 whosedepth is 0 is encoded by dividing the maximum coding unit into subcoding units whose depths are equal to or greater than 1. That is, themaximum coding unit 810 is divided into 4 sub coding units whose depthsare 1, and all or some of the sub coding units whose depths are 1 aredivided into sub coding units whose depths are 2.

A sub coding unit located in an upper-right side and a sub coding unitlocated in a lower-left side among the sub coding units whose depths are1 are divided into sub coding units whose depths are equal to or greaterthan 2. Some of the sub coding units whose depths are equal to orgreater than 2 may be divided into sub coding units whose depths areequal to or greater than 3.

The right side of FIG. 8A shows a division shape of a prediction unitfor the maximum coding unit 810. Referring to the right side of FIG. 8A,a prediction unit 860 for the maximum coding unit 810 can be divideddifferently from the maximum coding unit 810. In other words, aprediction unit for each of sub coding units can be smaller than acorresponding sub coding unit.

For example, a prediction unit for a sub coding unit 854 located in alower-right side among the sub coding units whose depths are 1 can besmaller than the sub coding unit 854. In addition, prediction units forsome sub coding units 814, 816, 850, and 852 of sub coding units 814,816, 818, 828, 850, and 852 whose depths are 2 can be smaller than thesub coding units 814, 816, 850, and 852, respectively. In addition,prediction units for sub coding units 822, 832, and 848 whose depths are3 can be smaller than the sub coding units 822, 832, and 848,respectively. The prediction units may have a shape whereby respectivesub coding units are equally divided by two in a direction of height orwidth or have a shape whereby respective sub coding units are equallydivided by four in directions of height and width.

FIG. 8B illustrates a prediction unit and a transformation unit,according to an exemplary embodiment. A left side of FIG. 8B shows adivision shape of a prediction unit for the maximum coding unit 810shown in the right side of FIG. 8A, and a right side of FIG. 8B shows adivision shape of a transformation unit of the maximum coding unit 810.

Referring to the right side of FIG. 8B, a division shape of atransformation unit 870 can be set differently from the prediction unit860. For example, even though a prediction unit for the coding unit 854whose depth is 1 is selected with a shape whereby the height of thecoding unit 854 is equally divided by two, a transformation unit can beselected with the same size as the coding unit 854. Likewise, eventhough prediction units for coding units 814 and 850 whose depths are 2are selected with a shape whereby the height of each of the coding units814 and 850 is equally divided by two, a transformation unit can beselected with the same size as the original size of each of the codingunits 814 and 850.

A transformation unit may be selected with a smaller size than aprediction unit. For example, when a prediction unit for the coding unit852 whose depth is 2 is selected with a shape whereby the width of thecoding unit 852 is equally divided by two, a transformation unit can beselected with a shape whereby the coding unit 852 is equally divided byfour in directions of height and width, which has a smaller size thanthe shape of the prediction unit.

FIG. 9 is a block diagram of an apparatus 900 for encoding a motionvector, according to an exemplary embodiment. The apparatus 900 forencoding a motion vector may be included in the apparatus 100 describedabove with reference to FIG. 1 or the image encoder 400 described abovewith reference to FIG. 4. Referring to FIG. 9, the motion vectorencoding apparatus 900 includes a predictor 910, a first encoder 920,and a second encoder 930.

In order to decode a block encoded using inter prediction, i.e.,inter-picture prediction, information about a motion vector indicating aposition difference between a current block and a similar block in areference picture is used. Thus, information about motion vectors isencoded and inserted into a bitstream in an image encoding process.However, if the information about motion vectors is encoded and insertedas is, an overhead for encoding the information about motion vectorsincreases, thereby decreasing a compression ratio of image data.

Therefore, in an image encoding process, information about a motionvector is compressed by predicting a motion vector of a current block,encoding only a differential vector between a motion vector predictorgenerated as a result of prediction and an original motion vector, andinserting the encoded differential vector into a bitstream. FIG. 9illustrates an apparatus 900 for encoding a motion vector which usessuch a motion vector predictor.

Referring to FIG. 9, the predictor 910 determines whether a motionvector of a current block is prediction-encoded based on an explicitmode or an implicit mode.

As described above, such a codec as MPEG-4 H.264/MPEG-4 AVC uses motionvectors of previously encoded blocks adjacent to a current block topredict a motion vector of the current block. That is, a median ofmotion vectors of previously encoded blocks adjacent to left, upper, andupper-right sides of the current block is used as a motion vectorpredictor of the current block. Since motion vectors of all blocksencoded using inter prediction are predicted using the same method,information about a motion vector predictor does not have to be encodedseparately. However, the apparatus 100 or the image decoder 400according to one or more exemplary embodiments uses both a mode in whichinformation about a motion vector predictor is not encoded separatelyand a mode in which information about a motion vector predictor isencoded in order to more exactly predict a motion vector, which will nowbe described in detail.

(1) Explicit Mode

One of methods of encoding a motion vector predictor, which can beselected by the predictor 910, may implement a mode of explicitlyencoding information about a motion vector predictor of a current block.This explicit mode is a mode of calculating at least one motion vectorpredictor candidate and separately encoding information indicating whichmotion vector predictor is used to predict a motion vector of a currentblock. Motion vector predictor candidates according to one or moreexemplary embodiments will now be described with reference to FIGS. 10A,10B, and 11A to 11C.

FIGS. 10A and 10B illustrate motion vector predictor candidates of anexplicit mode, according to one or more exemplary embodiments. Referringto FIG. 10A, a motion vector predicting method according to an exemplaryembodiment can use one of motion vectors of previously encoded blocksadjacent to a current block as a motion vector predictor of the currentblock. A block a0 in the leftmost among blocks adjacent to an upper sideof the current block, a block b0 in the upper-most among blocks adjacentto a left side thereof, a block c adjacent to an upper-right sidethereof, a block d adjacent to an upper-left side thereof, and a block eadjacent to a lower-left side thereof can be used for motion vectorpredictors of the current block.

Referring to FIG. 10B, motion vectors of all blocks adjacent to acurrent block can be used as motion vector predictors of the currentblock. In other words, motion vectors of not only a block a0 in theleftmost among blocks adjacent to an upper side of the current block,but all blocks adjacent to the upper side thereof can be used as motionvector predictors of the current block. Furthermore, motion vectors ofnot only a block b0 in the upper-most among blocks adjacent to a leftside thereof, but all blocks adjacent to the left side thereof can beused as motion vector predictors of the current block.

Alternatively, a median value of motion vectors of adjacent blocks canbe used as a motion vector predictor. For example, median(mv_a0, mv_b0,mv_c) can be used a motion vector predictor of the current block,wherein mv_a0 denotes a motion vector of the block a0, mv_b0 denotes amotion vector of the block b0, and mv_c denotes a motion vector of theblock c.

FIGS. 11A to 11C illustrate motion vector predictor candidates of anexplicit mode, according to another exemplary embodiment. FIG. 11Aillustrates a method of calculating a motion vector predictor of aBi-directional Predictive Picture (referred to as a B picture),according to an exemplary embodiment. When a current picture including acurrent block is a B picture in which bi-directional prediction isperformed, a motion vector generated based on a temporal distance may bea motion vector predictor.

Referring to FIG. 11A, a motion vector predictor of a current block 1100of a current picture 1110 can be generated using a motion vector of ablock 1120 in a co-located position of a temporally preceding picture1112. For example, if a motion vector mv_colA of the block 1120 in aposition co-located with the current block 1100 is generated for asearched block 1122 of a temporally following picture 1114 of thecurrent picture 1110, motion vector predictor candidates mv_L0A andmv_L1A of the current block 1100 can be generated in accordance with theequations below:mv _(—) L1A=(t1/t2)×mv _(—) colAmv _(—) L0A=mv _(—) L1A−mv _(—) colAwhere mv_L0A denotes a motion vector predictor of the current block 1100for the temporally preceding picture 1112, and mv_L1A denotes a motionvector predictor of the current block 1100 for the temporally followingpicture 1114.

FIG. 11B illustrates a method of generating a motion vector predictor ofa B picture, according to another exemplary embodiment. Compared withthe method illustrated in FIG. 11A, a block 1130 in a positionco-located with the current block 1100 exists in the temporallyfollowing picture 1114 in FIG. 11B.

Referring to FIG. 11B, a motion vector predictor of the current block1100 of the current picture 1110 can be generated using a motion vectorof a block 1130 in a co-located position of the temporally followingpicture 1114. For example, if a motion vector mv_colB of the block 1130in a position co-located with the current block 1100 is generated for asearched block 1132 of the temporally preceding picture 1112 of thecurrent picture 1110, motion vector predictor candidates mv_LOB andmv_L1B of the current block 1100 can be generated in accordance with theequations below:mv _(—) L0B=(t3/t4)×mv _(—) colBmv _(—) L1B=mv _(—) L0B−mv _(—) colBwhere mv_L0B denotes a motion vector predictor of the current block 1100for the temporally preceding picture 1112, and mv_L1B denotes a motionvector predictor of the current block 1100 for the temporally followingpicture 1114.

In the generation of a motion vector of the current block 1100 of a Bpicture, at least one of the methods illustrated in FIGS. 11A and 11Bcan be used. In other words, since a motion vector predictor isgenerated using a motion vector and a temporal distance of the block1120 or 1130 in a position co-located with the current block 1100,motion vector predictors can be generated using the methods illustratedin FIGS. 11A and 11B if motion vectors of the blocks 1120 and 1130 inthe co-located position exist. Thus, the predictor 910 according to anexemplary embodiment may generate a motion vector predictor of thecurrent block 1100 using only a block having a motion vector among theblocks 1120 and 1130 in the co-located position.

For example, when the block 1120 in a co-located position of thetemporally preceding picture 1112 is encoded using intra predictioninstead of inter prediction, a motion vector of the block 1120 does notexist, and thus a motion vector predictor of the current block 1100cannot be generated using the method of generating a motion vectorpredictor as illustrated in FIG. 11A.

FIG. 11C illustrates a method of generating a motion vector predictor ofa B picture, according to an exemplary embodiment. Referring to FIG.11C, a motion vector predictor of the current block 1100 of the currentpicture 1110 can be generated using a motion vector of a block 1140 in aco-located position of the temporally preceding picture 1112. Forexample, if a motion vector mv_colC of the block 1130 in a positionco-located with the current block 1100 is generated for a searched block1142 of another temporally preceding picture 1116, a motion vectorpredictor candidate mv_L0C of the current block 1100 can be generated inaccordance with the equation below:mv _(—) L0C=(t6/t5)×mv _(—) colC.

Since the current picture 1110 is a P picture, the number of motionvector predictors of the current block 1100 is 1, unlike FIGS. 11A and11B.

In summary, a set C of motion vector predictor candidates according toFIGS. 10A, 10B, and 11A to 11C can be generated in accordance with theequation below:C={median(mv _(—) a0, mv _(—) b0, mv _(—) c), mv _(—) a0, mv _(—) a1 . .. , mv _(—) aN, mv _(—) b0, mv _(—) b1, . . . , mv _(—) aN, mv _(—) c,mv _(—) d, mv _(—) e, mv_temporal}.

Alternatively, the set C may be generated by reducing the number ofmotion vector predictor candidates in accordance with the equationbelow:C={median(mv _(—) a′, mv _(—) b′, mv _(—) c′), mv _(—) a′, mv _(—) b′,mv _(—) c′, mv_temporal}.

Herein, mv_x denotes a motion vector of a block x, median( ) denotes amedian value, and mv_temporal denotes motion vector predictor candidatesgenerated using a temporal distance described above in association withFIGS. 11A to 11C.

In addition, mv_a′ denotes a very first valid motion vector among mv_a0,mv_a1 . . . , mv_aN. For example, when a block a0 is encoded using intraprediction, a motion vector mv_a0 of the block a0 is not valid, and thusmv_a′=mv_a1, and if a motion vector of a block a1 is also not valid,mv_a′=mv_a2.

Likewise, mv_b′ denotes a first valid motion vector among mv_b0, mv_b1 .. . , mv_bN, and mv_c′ denotes a first valid motion vector among mv_c,mv_d, and mv_e.

The explicit mode is a mode of encoding information indicating whichmotion vector has been used for a motion vector predictor of a currentblock. For example, when a motion vector is encoded in the explicitmode, a binary number can be allocated to each of elements of the set C,i.e., motion vector predictor candidates, and if one of the candidatesis used as a motion vector predictor of a current block, a correspondingbinary number can be output.

It will be easily understood by those of ordinary skill in the art thatother motion vector predictor candidates besides those described abovein association with the explicit mode can be used.

(2) Implicit Mode

Another one of the methods of encoding a motion vector predictor, whichcan be selected by the predictor 910, implements a mode of encodinginformation indicating that a motion vector predictor of a current blockis generated based on blocks or pixels included in a previously encodedarea adjacent to the current block. Unlike the explicit mode, this modeis a mode of encoding information indicating generation of a motionvector predictor in the implicit mode without encoding information forspecifying a motion vector predictor.

As described above, such a codec as MPEG-4 H.264/MPEG-4 AVC uses motionvectors of previously encoded blocks adjacent to a current block topredict a motion vector of the current block. That is, a median ofmotion vectors of previously encoded blocks adjacent to left, upper, andupper-right sides of the current block is used as a motion vectorpredictor of the current block. In this case, unlike the explicit mode,information for selecting one of motion vector predictor candidates maynot be encoded.

In other words, if only information indicating that a motion vectorpredictor of a current block has been encoded in the implicit mode isencoded in an image encoding process, a median value of motion vectorsof previously encoded blocks adjacent to left, upper, and upper-rightsides of the current block can be used as a motion vector predictor ofthe current block in an image decoding process.

In addition, an image encoding method according to an exemplaryembodiment provides a new implicit mode besides the method of using amedian value of motion vectors of previously encoded blocks adjacent toleft, upper, and upper-right sides of a current block as a motion vectorpredictor of the current block. This will now be described in detailwith reference to FIG. 12.

FIG. 12 illustrates a method of generating a motion vector predictor inan implicit mode, according to an exemplary embodiment. Referring toFIG. 12, pixels 1222 included in a previously encoded area 1220 adjacentto a current block 1200 of a current picture 1210 are used to generate amotion vector predictor of the current block 1200. Corresponding pixels1224 are determined by searching a reference picture 1212 using theadjacent pixels 1222. The corresponding pixels 1224 can be determined bycalculating a Sum of Absolute Differences (SAD). When the correspondingpixels 1224 are determined, a motion vector mv_template of the adjacentpixels 1222 is generated, and the motion vector mv_template can be usedas a motion vector predictor of the current block 1200.

If a mode of using a median of motion vectors of adjacent blocks as amotion vector predictor is defined as “implicit mode_1,” and if a modeof generating a motion vector predictor using pixels adjacent to acurrent block is defined as “implicit mode_2,” a motion vector predictorcan be generated using one of the two implicit modes implicit mode_1 andimplicit mode_2 by encoding information about one of the two implicitmodes in an image encoding process and referring to the informationabout a mode in an image decoding process.

(3) Mode Selection

There may be various criteria for the predictor 910 to select one of theabove-described explicit mode and implicit mode.

Since one of a plurality of motion vector predictor candidates isselected in the explicit mode, a motion vector predictor more similar toa motion vector of a current block can be selected. However, sinceinformation indicating one of a plurality of motion vector predictorcandidates is encoded, a greater overhead than in the implicit modes mayoccur. Thus, for a coding unit having a great size, a motion vector maybe encoded in the explicit mode because a probability of increasing anerror occurring when a motion vector is wrongly predicted is higher fora coding unit having a great size than a coding unit having a small sizeand the number of overhead occurrence times decreases for each picture.

For example, when a picture equally divided into m coding units having asize of 64×64 is encoded in the explicit mode, the number of overheadoccurrence times is m. However, when a picture, which has the same size,equally divided into 4 m coding units having the size of 32×32 isencoded in the explicit mode, the number of overhead occurrence times is4 m.

Accordingly, the predictor 910 according to an exemplary embodiment mayselect one of the explicit mode and the implicit mode based on the sizeof a coding unit when a motion vector of a current block is encoded.

Since the size of a coding unit in the image encoding method and theimage decoding method according to exemplary embodiments described abovewith reference to FIGS. 1 to 8 is represented using a depth, thepredictor 910 determines based on a depth of a current block whether amotion vector of the current block is encoded in the explicit mode orthe implicit mode. For example, when coding units whose depths are 0 and1 are inter-predicted, motion vectors of the coding units are encoded inthe explicit mode, and when coding units whose depths are equal to orgreater than 2 are inter-predicted, motion vectors of the coding unitsare encoded in the implicit mode.

According to another exemplary embodiment, the predictor 910 may selectthe explicit mode or the implicit mode for each picture or slice unit.Since image characteristics are different for each picture or sliceunit, the explicit mode or the implicit mode can be selected for eachpicture or slice unit by considering these image characteristics. Motionvectors of coding units included in a current picture or slice can beprediction-encoded by selecting an optimal mode from among the explicitmode and the implicit mode in consideration of R-D cost.

For example, if motion vectors of coding units included in a picture orslice can be exactly predicted without using the explicit mode, motionvectors of all coding units included in the picture or slice may beprediction-encoded in the implicit mode.

According to another exemplary embodiment, the predictor 910 may selectthe explicit mode or the implicit mode based on whether a current blockhas been encoded in the skip mode. The skip mode is an encoding mode inwhich flag information indicating that a current block has been encodedin the skip mode is encoded without encoding a pixel value.

Furthermore, the skip mode is a mode in which a pixel value of a currentblock is not encoded since a prediction block generated by performingmotion compensation using a motion vector predictor as a motion vectorof the current block is similar to the current block. Thus, as a motionvector predictor is generated more similarly to a motion vector of acurrent block, a probability of encoding the current block in the skipmode is higher. Accordingly, a block encoded in the skip mode can beencoded in the explicit mode.

Referring back to FIG. 9, when the predictor 910 selects one of theexplicit mode and the implicit mode and determines a motion vectorpredictor according to the selected mode, the first encoder 920 and thesecond encoder 930 encode information about an encoding mode and amotion vector.

Specifically, the first encoder 920 encodes information about a motionvector predictor of a current block. In more detail, when the predictor910 determines that a motion vector of the current block is encoded inthe explicit mode, the first encoder 920 encodes information indicatingthat a motion vector predictor has been generated in the explicit modeand information indicating which motion vector predictor candidate hasbeen used as the motion vector predictor of the current block.

In contrast, when the predictor 910 selects that the motion vector ofthe current block is encoded in the implicit mode, the first encoder 920encodes information indicating that the motion vector predictor of thecurrent block has been generated in the implicit mode. In other words,the first encoder 920 encodes information indicating the motion vectorpredictor of the current block has been generated using blocks or pixelsadjacent to the current block. If two or more implicit modes are used,the first encoder 920 may further encode information indicating whichimplicit mode has been used to generate the motion vector predictor ofthe current block.

The second encoder 930 encodes a motion vector of a current block basedon a motion vector predictor determined by the predictor 910.Alternatively, the second encoder 930 generates a difference vector bysubtracting the motion vector predictor generated by the predictor 910from the motion vector of the current block generated as a result ofmotion compensation and encodes information about the difference vector.

FIG. 13 is a block diagram of an apparatus 1300 for decoding a motionvector, according to an exemplary embodiment. The apparatus 1300 fordecoding the motion vector may be included in the image decodingapparatus 200 described above with reference FIG. 2 or the image decoder500 described above with reference to FIG. 5. Referring to FIG. 13, amotion vector decoding apparatus 1300 includes a first decoder 1310, asecond decoder 1320, a predictor 1330, and a motion vector restorer1340.

The first decoder 1310 decodes information about a motion vectorpredictor of a current block, which is included in a bitstream. Indetail, the first decoder 1310 decodes information indicating whetherthe motion vector predictor of the current block has been encoded in theexplicit mode or the implicit mode. When the motion vector predictor ofthe current block has been encoded in the explicit mode, the firstdecoder 1310 further decodes information indicating a motion vectorpredictor used as the motion vector predictor of the current block amonga plurality of motion vector predictors. When the motion vectorpredictor of the current block has been encoded in the implicit mode,the first decoder 1310 may further decode information indicating whichof a plurality of implicit modes has been used to encode the motionvector predictor of the current block.

The second decoder 1320 decodes a difference vector between a motionvector and the motion vector predictor of the current block included inthe bitstream.

The predictor 1330 generates a motion vector predictor of the currentblock based on the information about the motion vector predictor of thecurrent block, which has been decoded by the first decoder 1310.

When the information about the motion vector predictor of the currentblock, which has been encoded in the explicit mode, is decoded, thepredictor 1330 generates a motion vector predictor among the motionvector predictor candidates described above with reference to FIGS. 10A,10B, and 11A to 11C and uses the generated motion vector predictor asthe motion vector predictor of the current block.

When the information about the motion vector predictor of the currentblock, which has been encoded in the implicit mode, is decoded, thepredictor 1330 generates the motion vector predictor of the currentblock using blocks or pixels included in a previously encoded areaadjacent to the current block. In more detail, the predictor 1330generates a median value of motion vectors of blocks adjacent to thecurrent block as the motion vector predictor of the current block orgenerates the motion vector predictor of the current block by searchinga reference picture using pixels adjacent to the current block.

The motion vector restorer 1340 restores a motion vector of the currentblock by summing the motion vector predictor generated by the predictor1330 and the difference vector decoded by the second decoder 1320. Therestored motion vector is used for motion compensation of the currentblock.

FIG. 14 is a flowchart of a method of encoding a motion vector,according to an exemplary embodiment. Referring to FIG. 14, a motionvector encoding apparatus 900 according to an exemplary embodiment ofselects one of an explicit mode and an implicit mode as a mode ofencoding information about a motion vector predictor in operation 1410.

The explicit mode is a mode of encoding information indicating a motionvector predictor candidate among at least one motion vector predictorcandidate as information about a motion vector predictor, and theimplicit mode is a mode of encoding information indicating that a motionvector predictor has been generated based on blocks or pixels includedin a previously encoded area adjacent to a current block as informationabout the motion vector predictor. Detailed descriptions thereof havebeen given above with reference to FIGS. 10A, 10B, 11A to 11C, and 12.

A mode may be selected based on the size of a current block, i.e., adepth of the current block, or selected in a unit of a current pictureor slice in which the current block is included. Alternatively, a modemay be selected according to whether the current block has been encodedin a skip mode.

In operation 1420, the motion vector encoding apparatus 900 determines amotion vector predictor according to the mode selected in operation1410. In detail, the motion vector encoding apparatus 900 determines amotion vector predictor of the current block based on the explicit modeor implicit mode selected in operation 1410. In more detail, the motionvector encoding apparatus 900 determines a motion vector predictorcandidate among at least one motion vector predictor candidate as themotion vector predictor of the current block in the explicit mode ordetermines the motion vector predictor of the current block based onblocks or pixels adjacent to the current block in the implicit mode.

In operation 1430, the motion vector encoding apparatus 900 encodesinformation about the motion vector predictor determined in operation1420. In the case of the explicit mode, the motion vector encodingapparatus 900 encodes information indicating a motion vector predictorcandidate among at least one motion vector predictor candidate as themotion vector predictor of the current block and information indicatingthat information about the motion vector predictor of the current blockhas been encoded in the explicit mode. In the case of the implicit mode,the motion vector encoding apparatus 900 encodes information indicatingthat the motion vector predictor of the current block has been generatedbased on blocks or pixels included in a previously encoded area adjacentto the current block. In the case of a plurality of implicit modes, themotion vector encoding apparatus 900 may further encode informationindicating one of the plurality of implicit modes.

In operation 1440, the motion vector encoding apparatus 900 encodes adifference vector generated by subtracting the motion vector predictordetermined in operation 1420 from a motion vector of the current block.

FIG. 15 is a flowchart of a method of decoding a motion vector,according to an exemplary embodiment. Referring to FIG. 15, a motionvector decoding apparatus 1300 according to an exemplary embodimentdecodes information about a motion vector predictor of a current block,which is included in a bitstream, in operation 1510. In detail, themotion vector decoding apparatus 1300 decodes information about a modeused to encode the motion vector predictor of the current block fromamong an explicit mode and an implicit mode.

In the case of the explicit mode, the motion vector decoding apparatus1300 decodes information indicating that the motion vector predictor ofthe current block has been encoded in the explicit mode and informationabout a motion vector predictor candidate among at least one motionvector predictor candidate. In the case of the implicit mode, the motionvector decoding apparatus 1300 decodes information indicating that themotion vector predictor of the current block has been generated based onblocks or pixels included in a previously decoded area adjacent to thecurrent block. In the case of a plurality of implicit modes, the motionvector decoding apparatus 1300 may further decode information indicatingone of the plurality of implicit modes.

In operation 1520, the motion vector decoding apparatus 1300 decodesinformation about a difference vector. The difference vector is a vectorof a difference between the motion vector predictor of the current blockand a motion vector of the current block.

In operation 1530, the motion vector decoding apparatus 1300 generatesthe motion vector predictor of the current block based on theinformation about the motion vector predictor, which has been decoded inoperation 1510. In detail, the motion vector decoding apparatus 1300generates the motion vector predictor of the current block according tothe explicit mode or the implicit mode. In more detail, the motionvector decoding apparatus 1300 generates the motion vector predictor ofthe current block by selecting a motion vector predictor candidate amongat least one motion vector predictor candidate or using blocks or pixelsincluded in a previously decoded area adjacent to the current block.

In operation 1540, the motion vector decoding apparatus 1300 restoresthe motion vector of the current block by summing the difference vectordecoded in operation 1520 and the motion vector predictor generated inoperation 1530.

While exemplary embodiments have been particularly shown and describedabove, it will be understood by those of ordinary skill in the art thatvarious changes in form and details may be made therein withoutdeparting from the spirit and scope of the present inventive concept asdefined by the following claims.

In addition, a system according to an exemplary embodiment can beimplemented using a computer readable code in a computer readablerecording medium. For example, at least one of an apparatus 100 forencoding an image, an apparatus 200 for decoding an image, an imageencoder 400, an image decoder 500, a motion vector encoding apparatus900, and a motion vector decoding apparatus 1300, according to exemplaryembodiments, may include a bus coupled to units of each of the devicesshown in FIGS. 1, 2, 4, 5, 9, and 13 and at least one processorconnected to the bus. In addition, a memory coupled to at least oneprocessor for performing commands as described above can be included andconnected to the bus to store the commands and received messages orgenerated messages.

The computer readable recording medium is any data storage device thatcan store data which can be thereafter read by a computer system.Examples of the computer readable recording medium include read-onlymemory (ROM), random-access memory (RAM), CD-ROMs, magnetic tapes,floppy disks and, optical data storage devices. The computer readablerecording medium can also be distributed over network coupled computersystems so that the computer readable code is stored and executed in adistributed fashion.

What is claimed is:
 1. A method of decoding an image, the methodcomprising: obtaining a prediction mode information of a current blockfrom a bitstream; determining motion vector predictor candidates fromamong motion vectors of adjacent blocks adjacent to the current block;and determining a motion vector predictor of the current block fromamong the motion vector predictor candidates based on prediction modeinformation of the current block, wherein the adjacent blocks comprise afirst block outside the current block located adjacent and to the leftof a leftmost block among blocks adjacent to a lower side of the currentblock and located adjacent and below a lowermost block among blocksadjacent to a left side of the current block.
 2. A method of decoding animage, the method comprising: obtaining a prediction mode information ofa current block from a bitstream; determining motion vector predictorcandidates from among motion vectors of adjacent blocks adjacent to thecurrent block; and determining a motion vector predictor of the currentblock from among the motion vector predictor candidates based onprediction mode information of the current block, wherein the adjacentblocks comprise a first block outside the current block located on alower-left side of the current block, wherein the image ishierarchically split from a plurality of maximum coding units, accordingto information about a maximum size of a coding unit, into coding unitsof coded depths according to depths, wherein a coding unit of a currentdepth is one of rectangular data units split from a coding unit of anupper depth, wherein the coding unit of the current depth is split intocoding units of a lower depth, independently from neighboring codingunits, and wherein coding units of a hierarchical structure compriseencoded coding units among the coding units split from a maximum codingunit.